const setUserToken = ((userToken) => {
	uni.setStorageSync('userToken', userToken);
})
const getUserToken = (() => {
	return uni.getStorageSync('userToken');
})
//登录手机号(脱敏)
const setPhoneDes = ((phone) => {
	uni.setStorageSync('phoneDes', phone);
})
const getPhoneDes = (() => {
	return uni.getStorageSync('phoneDes');
})
//登录手机号
const setPhone = ((phone) => {
	uni.setStorageSync('phone', phone);
})
const getPhone = (() => {
	return uni.getStorageSync('phone');
})
const setKey = ((key) => {
	uni.setStorageSync('key', key);
})
const getKey = (() => {
	return uni.getStorageSync('key');
})
const getIsLogin = (() => {
	const userToken = uni.getStorageSync("userToken");
	if (userToken) {
		return true;
	} else {
		uni.navigateTo({
			url: '/pagesChild/login/login'
		});
	}
})
export const storage = {
	getUserToken,
	setUserToken,
	setPhone,
	getPhone,
	setPhoneDes,
	getPhoneDes,
	getIsLogin,
	setKey,
	getKey,
}
